package myky.com.doctorapp.model

import com.xiangyao.train.utils.RxScedulerHelper
import io.reactivex.Observable
import myky.com.doctorapp.api.ApiManager
import myky.com.doctorapp.base.BaseEntity
import myky.com.doctorapp.contract.FollowRecordListContract
import myky.com.doctorapp.entity.FollowRecordEntity
import myky.com.doctorapp.utils.Constants
import myky.com.doctorapp.utils.RequestBodyBuilder

/**
 * Description:
 *
 * @author wuyangwuyang
 * Created by 2019/3/19 on 17:38
 */
class FollowRecordListModel : FollowRecordListContract.Model {
    override fun getFollowRecordList(current: Int,doctorId:Int): Observable<BaseEntity<FollowRecordEntity.DataBean>> {
        val requestBodyBuilder = RequestBodyBuilder.Builder()
        val build = requestBodyBuilder.params("version", Constants.CURRENTVERSION)
                .params("size", 10)
                .params("current", current)
                .params("doctorid", doctorId)
                .build_Map()
        return ApiManager.getApistore().getFollowRecordList(build).compose(RxScedulerHelper.io_main())
    }
}
